﻿using Nest;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ES.Client.Filter
{
    public class BaseFilter<T> where T : class
    {
        protected string Index { get; set; }

        protected string DocType { get; set; }

        protected ElasticHub<T> Hub
        {
            get
            {
                return new ElasticHub<T>(this.Index);
            }
        }

        protected virtual bool TryGetProperty(string field, out IProperty property)
        {
            return this.Hub.TryGetFieldMapping(field, out property);
        }
    }
}
